package com.imooc.sell.utils;

import java.util.Random;

public class KeyUtil {
    /*
     * 生成唯一的主键
     * 格式：时间+随机数
     * @return java.lang.String
     **/
    public static synchronized String getUniqueKey(){
        Random random = new Random();
        System.currentTimeMillis();
        Integer number = random.nextInt(900000)+100000;
        return System.currentTimeMillis()+String.valueOf(number);
    }
}
